package com.yihaodian.search.fetch;

import com.yihaodian.index.meta.shard.Shard;
import com.yihaodian.search.query.QuerySearchResult;
import com.yihaodian.search.query.QuerySearchResultProvider;

public class QueryFetchSearchResult implements QuerySearchResultProvider,
		FetchSearchResultProvider {
	
	private QuerySearchResult queryResult;
	private FetchSearchResult fetchResult;

	@Override
	public long id() {
		return queryResult.id();
	}
	
	public QueryFetchSearchResult() {
		
	}
	
	public QueryFetchSearchResult(QuerySearchResult queryResult, FetchSearchResult fetchResult) {
		this.queryResult = queryResult;
		this.fetchResult = fetchResult;
	}

	@Override
	public Shard getShard() {
		return queryResult.getShard();
	}
	
	@Override
	public void setShard(Shard shard) {
		queryResult.setShard(shard);
		fetchResult.setShard(shard);
	}

	@Override
	public FetchSearchResult fetchResult() {
		return fetchResult;
	}
	
	@Override
	public boolean includeFetch() {
		return true;
	}

	@Override
	public QuerySearchResult queryResult() {
		return queryResult;
	}

}
